Previous | Home | Next |
SQL> select sal, (to_char(to_date(sal,'j'), 'jsp')) from emp;
The output like, SAL (TO_CHAR(TO_DATE(SAL,'J'),'JSP')) 800 eight hundred 1600 one thousand six hundred 1250 one thousand two hundred fifty If you want to add some text like, Rs. Three Thousand only. SQL> select sal "Salary ", (' Rs. '|| (to_char(to_date(sal,'j'), 'Jsp'))|| ' only.')) "Sal in Words" from emp / Salary Sal in Words ------- ------------------------------------------------------ 800 Rs. Eight Hundred only. 1600 Rs. One Thousand Six Hundred only. 1250 Rs. One Thousand Two Hundred Fifty only.
Odd number of records:
select * from emp where (rowid,1) in (select rowid, mod(rownum,2) from emp);
1 3 5
Even number of records:
select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
2 4 6
months_between
Any three PL/SQL Exceptions?
Too_many_rows, No_Data_Found, Value_Error, Zero_Error, Others
What are PL/SQL Cursor Exceptions?
Cursor_Already_Open, Invalid_Cursor
Other way to replace query result null value with a text
SQL> Set NULL ‘N/A’
to reset SQL> Set NULL ‘’
SYSDATE, USER , UID, CURVAL, NEXTVAL, ROWID, ROWNUM
What is the output of SIGN function?
- 1 for positive value,
- 0 for Zero,
- -1 for Negative value.
What is the maximum number of triggers, can apply to a single table?
12 triggers.
Previous | Home | Next |